SetThemeBackground
NEW WITH THE APPEARANCE MANAGER
Sets an element's background color or pattern to comply with the current theme.
pascal OSStatus SetThemeBackground ( ThemeBrush inBrush, SInt16 inDepth, Boolean inIsColorDevice);
inBrush
- A value representing the pattern or color to which the background is to be set; see "Appearance-Compliant Brush Type Constants".
inDepth
- The bit depth (in pixels) of the current graphics port.
inIsColorDevice
- A Boolean value. Set to
true
to indicate that you are drawing on a color device. Set tofalse
for a monochrome device.- function result
- A result code. The result code
appearanceBadBrushIndexErr
indicates that the brush constant passed was not valid. For a list of other result codes, see "Result Codes".DISCUSSION
TheSetThemeBackground
function should be called each time you wish to draw an element in a specified brush constant using Appearance Manager draw functions.The constant in the
inBrush
parameter can represent a color or pattern, depending on the current theme. Because it could specify a pattern, remember to save and restore thepnPixPat
andbkPixPat
fields of your graphics port when saving the text and background colors. Because patterns in thebkPixPat
field override the background color of the window, call the Window Manager functionBackPat
to set your background pattern to a normal white pattern. This will ensure that you can useRGBBackColor
to set your background color to white, call the Window Manager functionEraseRect
, and get the expected results.